from math import *
a = []
for i in range(1, 9999999):
    if gcd(i, 2024) == 1:
        a.append(i)
    if len(a) == 2024:
        break
print(a[-1])
